from peewee import *
from .base import BaseModel
from datetime import datetime

class Article(BaseModel):
    id: int = AutoField(primary_key=True)
    title: str = CharField(default='')
    content: str = CharField(default='')
    create_at: int = IntegerField(default=datetime.now().timestamp())  # 创建时间
    update_at: int = IntegerField(default=datetime.now().timestamp())  # 更新时间
    class Meta:
        table_name = 'article'

class Help(BaseModel):
    id: int = AutoField(primary_key=True)
    title: str = CharField(default='')
    content: str = CharField(default='')
    class Meta:
        table_name = 'help'

class Feedback(BaseModel):
    id: int = AutoField(primary_key=True)
    title: str = CharField(default='')
    content: str = CharField(default='')
    reply: str = CharField(default='')
    reply_at: int = IntegerField(default=0)  # 回复时间
    create_at: int = IntegerField(default=datetime.now().timestamp())  # 创建时间
    update_at: int = IntegerField(default=datetime.now().timestamp())  # 更新时间
    class Meta:
        table_name = 'feedback'
